package com.study;

/*
    数字相加
 */
public class OperatorDemo1 {
    public static void main(String[] args) {
        int a = 10;
        double b = 13.14;
        System.out.println(a + b);

//        int c = a + b; 报错。结果隐式转换成了double类型（自动转换）
        double c = a + b;

        short s = 10;
        int i = 99;
//        short j = s + j;
        int j = s + i;
        short k = (short)(i + j); // 强制类型转换，将隐式转换成int类型的结果强制转换成short类型（可能会丢失数据和精度）
    }
}
